package han.chensing.latos.game.util;

import han.chensing.latos.V;
import han.chensing.latos.common.level.LatosProject;
import han.chensing.latos.common.level.content.CommonLine;
import han.chensing.latos.common.level.content.LevelData;
import han.chensing.latos.game.elements.notes.Note;

import java.util.ArrayList;

public class NoteUtil {
    public static boolean isInBox(Note n){
        float x=n.getX();
        float y=n.getY();
        return (x<= V.WIDTH+200f)&&(x>=-200f)&&
                (y>=-200f)&&(y<=V.HEIGHT+200f);
    }

    public static int getFullCombo(LatosProject latosProject){
        int combo=0;
        LevelData levelData = latosProject.getLevelData();
        ArrayList<CommonLine> commonLines = levelData.getLines();
        for (CommonLine commonLine : commonLines) {
            combo+=commonLine.getNotes().size();
        }
        return combo;
    }
}
